﻿using FwtXnaGame3.Engine;
using GpgCore;
using GpgGame.GameObjects.Corps;
using GpgGame.GameObjects.PlanetMaps;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;

namespace GpgGame.Scenes
{
    public class PlanetMapScene : Scene
    {
        public VisualPlanetMap Map;

        public override void Load()
        {
            Map = AddObject(new VisualPlanetMap(this, GodObject.Planet));
            Map.Transform2D.CenterOnPoint(Vector2.Zero);
            Map.Transform2D.Position += new Vector2(0.5f);

            AddObject(new CorpToolBar(this));

            base.Load();
        }

        public override void Update(GameTime gameTime)
        {
            var moveSpeed = 3;
            if (KeybState.IsKeyDown(Keys.LeftShift))
                moveSpeed *= 10;
            if (KeybState.IsKeyDown(Keys.W))
                Map.Transform2D.Position += new Vector2(0, moveSpeed);
            if (KeybState.IsKeyDown(Keys.S))
                Map.Transform2D.Position += new Vector2(0, -moveSpeed);
            if (KeybState.IsKeyDown(Keys.A))
                Map.Transform2D.Position += new Vector2(moveSpeed, 0);
            if (KeybState.IsKeyDown(Keys.D))
                Map.Transform2D.Position += new Vector2(-moveSpeed, 0);

            base.Update(gameTime);
        }
    }
}
